home *** CD-ROM | disk | FTP | other *** search
/ BCI NET 2 / BCI NET 2.iso / archives / programming / languages / obrn-a_1.5_lib.lha / oberon-a / source1.lha / source / amiga / Exec.mod < prev    next >
Encoding:
Text File  |  1995-01-26  |  53.9 KB  |  1,707 lines

  1. (*************************************************************************
  2.  
  3.      $RCSfile: Exec.mod $
  4.   Description: Interface to exec.library
  5.  
  6.    Created by: fjc (Frank Copeland)
  7.     $Revision: 3.7 $
  8.       $Author: fjc $
  9.         $Date: 1995/01/26 02:39:55 $
  10.  
  11.   Includes Release 40.15
  12.  
  13.   (C) Copyright 1985-1993 Commodore-Amiga, Inc.
  14.       All Rights Reserved
  15.  
  16.   Oberon-A interface Copyright © 1994-1995, Frank Copeland.
  17.   This file is part of the Oberon-A Interface.
  18.   See Oberon-A.doc for conditions of use and distribution.
  19.  
  20. *************************************************************************)
  21.  
  22. <* STANDARD- *> <* INITIALISE- *> <* MAIN- *>
  23. <*$ CaseChk-  IndexChk- LongVars+ NilChk-  *>
  24. <*$ RangeChk- StackChk- TypeChk-  OvflChk- *>
  25.  
  26. MODULE [2] Exec;
  27.  
  28. IMPORT SYS := SYSTEM, s := Sets;
  29.  
  30. (**-- Pointer declarations ---------------------------------------------*)
  31.  
  32. TYPE
  33.  
  34.   MinNodePtr*          = POINTER TO MinNode;
  35.   NodePtr*             = POINTER TO Node;
  36.   MinListPtr*          = POINTER TO MinList;
  37.   ListPtr*             = POINTER TO List;
  38.   ResidentPtr*         = POINTER TO Resident;
  39.   MemChunkPtr*         = POINTER TO MemChunk;
  40.   MemHeaderPtr*        = POINTER TO MemHeader;
  41.   MemEntryPtr*         = POINTER TO MemEntry;
  42.   MemListPtr*          = POINTER TO MemList;
  43.   TaskPtr*             = POINTER TO Task;
  44.   StackSwapStructPtr*  = POINTER TO StackSwapStruct;
  45.   MsgPortPtr*          = POINTER TO MsgPort;
  46.   MsgPortSoftIntPtr*   = POINTER TO MsgPortSoftInt;
  47.   MessagePtr*          = POINTER TO Message;
  48.   InterruptPtr*        = POINTER TO Interrupt;
  49.   IntVectorPtr         = POINTER TO IntVector;
  50.   SoftIntListPtr       = POINTER TO SoftIntList;
  51.   SemaphoreRequestPtr  = POINTER TO SemaphoreRequest;
  52.   SignalSemaphorePtr*  = POINTER TO SignalSemaphore;
  53.   SemaphorePtr*        = POINTER TO Semaphore;
  54.   LibraryPtr*          = POINTER TO Library;
  55.   DevicePtr*           = POINTER TO Device;
  56.   UnitPtr*             = POINTER TO Unit;
  57.   IORequestPtr*        = POINTER TO IORequest;
  58.   IOStdReqPtr*         = POINTER TO IOStdReq;
  59.   ExecBasePtr*         = POINTER TO ExecBase;
  60.   MemHandlerDataPtr *  = POINTER TO MemHandlerData;
  61.   MemPoolPtr *         = POINTER TO RECORD END;
  62.  
  63.  
  64. (**-- Library definitions ----------------------------------------------*)
  65.  
  66. (*
  67. **      $VER: initializers.h 39.0 (15.10.91)
  68. **
  69. **      Macros for use with the InitStruct() function.
  70. **
  71. **      Not ported.
  72. *)
  73.  
  74. (*
  75. **      $VER: types.h 40.1 (10.8.93)
  76. **
  77. **      Data typing.
  78. *)
  79.  
  80. CONST
  81.  
  82.   includeVersion* = 40; (* Version of the include files in use. (Do not
  83.                           use this label for OpenLibrary() calls!) *)
  84.  
  85. TYPE
  86.  
  87.   (*  WARNING: APTR was redefined for the V36 Includes!  APTR is a   *)
  88.  (*  32-Bit Absolute Memory Pointer.  C pointer math will not       *)
  89. (*  operate on APTR --  use "ULONG *" instead.                     *)
  90.  
  91.   ADDRESS * = SYS.ADDRESS;
  92.   APTR    * = SYS.ADDRESS;         (* 32-bit untyped pointer *)
  93.   BPTR    * = SYS.BPTR;
  94.  
  95.   LONG    * = LONGINT;             (* signed 32-bit quantity *)
  96.   ULONG   * = LONGINT;             (* unsigned 32-bit quantity *)
  97.   LONGBITS* = s.SET32;             (* 32 bits manipulated individually *)
  98.   WORD    * = INTEGER;             (* signed 16-bit quantity *)
  99.   UWORD   * = INTEGER;             (* unsigned 16-bit quantity *)
  100.   WORDBITS* = s.SET16;             (* 16 bits manipulated individually *)
  101.   BYTE    * = SYS.BYTE;            (* signed 8-bit quantity *)
  102.   UBYTE   * = SYS.BYTE;            (* unsigned 8-bit quantity *)
  103.   BYTEBITS* = s.SET8;              (* 8 bits manipulated individually *)
  104.   RPTR    * = INTEGER;             (* signed relative pointer *)
  105.   STRING  * = ARRAY 256 OF CHAR;
  106.   STRPTR  * = POINTER TO STRING;   (* string pointer (NULL terminated) *)
  107.   LSTRPTR * = POINTER TO ARRAY MAX(INTEGER)-1 OF CHAR;
  108.  
  109.  
  110. (* For compatibility only: (don't use in new code) *)
  111.   SHORT   * = INTEGER;             (* signed 16-bit quantity (use WORD) *)
  112.   USHORT  * = INTEGER;             (* unsigned 16-bit quantity (use UWORD) *)
  113.   COUNT   * = INTEGER;
  114.   UCOUNT  * = INTEGER;
  115.   CPTR    * = ULONG;
  116.  
  117.  
  118. (* Types with specific semantics *)
  119.   FLOAT   * = REAL;
  120.   DOUBLE  * = ARRAY 2 OF SYS.LONGWORD;
  121.   SINGLE  * = SYS.LONGWORD;
  122.   BOOL    * = INTEGER;
  123.   TEXT    * = CHAR;
  124.  
  125. CONST
  126.  
  127.   null           * = NIL;
  128.   byteMask       * = 0FFH;
  129.  
  130. (* Types convenient for Oberon-A programmers *)
  131.  
  132. TYPE
  133.  
  134.   PROC     * = PROCEDURE;
  135.   LBOOL    * = LONGINT;
  136.   LONGBOOL * = LBOOL;
  137.  
  138. (* Legal values for LBOOL types *)
  139.  
  140. CONST
  141.  
  142.   true   * = 1;
  143.   false  * = 0;
  144.   LTRUE  * = -1;
  145.   LFALSE * = 0;
  146.  
  147. (* Use these constants instead of the corresponding literals when passing
  148. ** parameters to Amiga library functions. This will result in clearer
  149. ** code, and will also assist when porting code to and from AmigaOberon.
  150. *)
  151.  
  152. CONST
  153.  
  154.   NILSTR   * = "";   (* Use when a NULL would be passed in C *)
  155.   EMPTYSTR * = "\o"; (* Use when an empty string would be passed in C *)
  156.  
  157.  (*   libraryVersion is now obsolete.  Please use libraryMinimum *)
  158. (* or code the specific minimum library version you require.            *)
  159.  
  160.   libraryMinimum* = 33; (* Lowest version supported by Commodore-Amiga *)
  161.  
  162. (*
  163. **      $VER: nodes.h 39.0 (15.10.91)
  164. **
  165. **      Nodes & Node type identifiers.
  166. *)
  167.  
  168. TYPE
  169.  
  170. (*
  171.  * Type compatible to MinNode and Node:
  172.  *)
  173.   CommonNode * = RECORD END;
  174.   CommonNodePtr * = POINTER TO CommonNode;
  175.  
  176. (*
  177.  *  List Node Structure.  Each member in a list starts with a Node
  178.  *)
  179.  
  180.   NodeBase *= RECORD (CommonNode) END;
  181.   Node * = RECORD (NodeBase)
  182.     succ* : NodePtr;   (* Pointer to next (successor) *)
  183.     pred* : NodePtr;   (* Pointer to previous (predecessor) *)
  184.     type* : SHORTINT;
  185.     pri*  : SHORTINT;  (* Priority, for sorting *)
  186.     name* : LSTRPTR;   (* ID string, null terminated *)
  187.   END; (* Node *)      (* Note: word aligned *)
  188.  
  189. (* minimal node -- no type checking possible *)
  190.  
  191.   MinNodeBase *= RECORD (CommonNode) END;
  192.   MinNode * = RECORD (MinNodeBase)
  193.     succ* : MinNodePtr;      (* Pointer to next (successor) *)
  194.     pred* : MinNodePtr;      (* Pointer to previous (predecessor) *)
  195.   END; (* MinNode *)
  196.  
  197.  
  198. CONST
  199.  
  200. (*
  201. ** Note: Newly initialized IORequests, and software interrupt structures
  202. ** used with Cause(), should have type ntUNKNOWN.  The OS will assign a type
  203. ** when they are first used.
  204. *)
  205. (* ----- Node Types for Node.type -----*)
  206.   unknown     * = 0;
  207.   task        * = 1;       (* Exec task *)
  208.   interrupt   * = 2;
  209.   device      * = 3;
  210.   msgPort     * = 4;
  211.   message     * = 5;       (* Indicates message currently pending *)
  212.   freeMsg     * = 6;
  213.   replyMsg    * = 7;       (* Message has been replied *)
  214.   resource    * = 8;
  215.   library     * = 9;
  216.   memory      * = 10;
  217.   softInt     * = 11;      (* Internal flag used by SoftInits *)
  218.   font        * = 12;
  219.   process     * = 13;      (* AmigaDOS Process *)
  220.   semaphore   * = 14;
  221.   signalSem   * = 15;      (* signal semaphores *)
  222.   bootNode    * = 16;
  223.   kickMem     * = 17;
  224.   graphics    * = 18;
  225.   deathMessage* = 19;
  226.   user        * = 254;     (* User node types work down from here *)
  227.   extended    * = 255;
  228.  
  229. (*
  230. **      $VER: lists.h 39.0 (15.10.91)
  231. **
  232. **      Definitions and macros for use with Exec lists
  233. *)
  234.  
  235. TYPE
  236.  
  237. (*
  238.  * Type compatible to MinList and List:
  239.  *)
  240.   CommonList * = RECORD END;
  241.   CommonListPtr * = POINTER TO CommonList;
  242.  
  243. (*
  244.  *  Full featured list header.
  245.  *)
  246.   List* = RECORD (CommonList)
  247.     head*     : NodePtr;
  248.     tail*     : NodePtr;
  249.     tailPred* : NodePtr;
  250.     type*     : SHORTINT;
  251.     pad*      : BYTE;
  252.   END; (* List *)      (* word aligned *)
  253.  
  254. (*
  255.  * Minimal List Header - no type checking
  256.  *)
  257.   MinList* = RECORD (CommonList)
  258.     head*     : MinNodePtr;
  259.     tail*     : MinNodePtr;
  260.     tailPred* : MinNodePtr;
  261.   END; (* MinList *)      (* longword aligned *)
  262.  
  263.  
  264. (*
  265. **      $VER: alerts.h 39.3 (12.5.92)
  266. **
  267. **      Alert numbers, as displayed by system crashes.
  268. *)
  269.  
  270. (*********************************************************************
  271. *
  272. *  Format of the alert error number:
  273. *
  274. *    +-+-------------+----------------+--------------------------------+
  275. *    |D|  SubSysId   |  General Error |    SubSystem Specific Error    |
  276. *    +-+-------------+----------------+--------------------------------+
  277. *     1    7 bits          8 bits                  16 bits
  278. *
  279. *                    D:  DeadEnd alert
  280. *             SubSysId:  indicates ROM subsystem number.
  281. *        General Error:  roughly indicates what the error was
  282. *       Specific Error:  indicates more detail
  283. **********************************************************************)
  284.  
  285. (**********************************************************************
  286. *
  287. *  Hardware/CPU specific alerts:  They may show without the 8 at the
  288. *  front of the number.  These are CPU/68000 specific.  See 680x0
  289. *  programmer's manuals for more details.
  290. *
  291. **********************************************************************)
  292.  
  293. CONST
  294.  
  295.   acpuBusErr     * = 080000002H;  (* Hardware bus fault/access error *)
  296.   acpuAddressErr * = 080000003H;  (* Illegal address access (ie: odd) *)
  297.   acpuInstErr    * = 080000004H;  (* Illegal instruction *)
  298.   acpuDivZero    * = 080000005H;  (* Divide by zero *)
  299.   acpuCHK        * = 080000006H;  (* Check instruction error *)
  300.   acpuTRAPV      * = 080000007H;  (* TrapV instruction error *)
  301.   acpuPrivErr    * = 080000008H;  (* Privilege violation error *)
  302.   acpuTrace      * = 080000009H;  (* Trace error *)
  303.   acpuLineA      * = 08000000AH;  (* Line 1010 Emulator error *)
  304.   acpuLineF      * = 08000000BH;  (* Line 1111 Emulator error *)
  305.   acpuFormat     * = 08000000EH;  (* Stack frame format error *)
  306.   acpuSpurious   * = 080000018H;  (* Spurious interrupt error *)
  307.   acpuAutoVec1   * = 080000019H;  (* AutoVector Level 1 interrupt error *)
  308.   acpuAutoVec2   * = 08000001AH;  (* AutoVector Level 2 interrupt error *)
  309.   acpuAutoVec3   * = 08000001BH;  (* AutoVector Level 3 interrupt error *)
  310.   acpuAutoVec4   * = 08000001CH;  (* AutoVector Level 4 interrupt error *)
  311.   acpuAutoVec5   * = 08000001DH;  (* AutoVector Level 5 interrupt error *)
  312.   acpuAutoVec6   * = 08000001EH;  (* AutoVector Level 6 interrupt error *)
  313.   acpuAutoVec7   * = 08000001FH;  (* AutoVector Level 7 interrupt error *)
  314.  
  315. (*********************************************************************
  316. *
  317. *  General Alerts
  318. *
  319. *  For example: timer.device cannot open math.library would be 05038015H
  320. *
  321. *       alert(an_timerdev|ag_openlib|ao_MathLib);
  322. *
  323. *********************************************************************)
  324.  
  325. CONST
  326.  
  327. (* ------ alert types *)
  328.   deadEnd     * = 80000000H;
  329.   recovery    * = 00000000H;
  330.  
  331.  
  332. (* ------ general purpose alert codes *)
  333.   noMemory    * = 00010000H;
  334.   makeLib     * = 00020000H;
  335.   openLib     * = 00030000H;
  336.   openDev     * = 00040000H;
  337.   openRes     * = 00050000H;
  338.   ioError     * = 00060000H;
  339.   noSignal    * = 00070000H;
  340.   badParm     * = 00080000H;
  341.   closeLib    * = 00090000H;      (* usually too many closes *)
  342.   closeDev    * = 000A0000H;      (* or a mismatched close *)
  343.   procCreate  * = 000B0000H;      (* Process creation failed *)
  344.  
  345.  
  346. (* ------ alert objects: *)
  347.   execLib     * = 00008001H;
  348.   graphicsLib * = 00008002H;
  349.   layersLib   * = 00008003H;
  350.   intuition   * = 00008004H;
  351.   mathLib     * = 00008005H;
  352.   dosLib      * = 00008007H;
  353.   ramLib      * = 00008008H;
  354.   iconLib     * = 00008009H;
  355.   expansionLib* = 0000800AH;
  356.   diskfontLib * = 0000800BH;
  357.   utilityLib  * = 0000800CH;
  358.   keyMapLib   * = 0000800DH;
  359.  
  360.   audioDev    * = 00008010H;
  361.   consoleDev  * = 00008011H;
  362.   gamePortDev * = 00008012H;
  363.   keyboardDev * = 00008013H;
  364.   trackDiskDev* = 00008014H;
  365.   timerDev    * = 00008015H;
  366.  
  367.   ciaRsrc     * = 00008020H;
  368.   diskRsrc    * = 00008021H;
  369.   miscRsrc    * = 00008022H;
  370.  
  371.   bootStrap   * = 00008030H;
  372.   workbench   * = 00008031H;
  373.   diskCopy    * = 00008032H;
  374.   gadTools    * = 00008033H;
  375.   atUnknown   * = 00008035H;
  376.  
  377.  
  378.  
  379. (*********************************************************************
  380. *
  381. *   Specific Alerts:
  382. *
  383. *********************************************************************)
  384.  
  385. (* ------ exec.library *)
  386.   anExecLib    * = 01000000H;
  387.   excptVect    * = 01000001H; (* 68000 exception vector checksum (obs.) *)
  388.   baseChkSum   * = 01000002H; (* Execbase checksum (obs.) *)
  389.   libChkSum    * = 01000003H; (* Library checksum failure *)
  390.  
  391.   memCorrupt   * = 81000005H; (* Corrupt memory list detected in FreeMem *)
  392.   intrMem      * = 81000006H; (* No memory for interrupt servers *)
  393.   initAPtr     * = 01000007H; (* InitStruct() of an APTR source (obs.) *)
  394.   semCorrupt   * = 01000008H; (* A semaphore is in an illegal state
  395.                                       at ReleaseSempahore() *)
  396.   freeTwice    * = 01000009H; (* Freeing memory already freed *)
  397.   bogusExcpt   * = 8100000AH; (* illegal 68k exception taken (obs.) *)
  398.   ioUsedTwice  * = 0100000BH; (* Attempt to reuse active IORequest *)
  399.   memoryInsane * = 0100000CH; (* Sanity check on memory list failed
  400.                                       during availmem(memfLARGEST) *)
  401.   ioAfterClose* = 0100000DH; (* IO attempted on closed IORequest *)
  402.   stackProbe  * = 0100000EH; (* Stack appears to extend out of range *)
  403.   badFreeAddr * = 0100000FH; (* Memory header not located. [ Usually an
  404.                                 invalid address passed to FreeMem() ] *)
  405.   badSemaphore* = 01000010H; (* An attempt was made to use the old
  406.                                 message semaphores. *)
  407.  
  408. (* ------ graphics.library *)
  409.   anGraphicsLib * = 02000000H;
  410.   gfxNoMem      * = 82010000H;      (* graphics out of memory *)
  411.   gfxNoMemMspc  * = 82010001H;      (* MonitorSpec alloc, no memory *)
  412.   longFrame     * = 82010006H;      (* long frame, no memory *)
  413.   shortFrame    * = 82010007H;      (* short frame, no memory *)
  414.   textTmpRas    * = 02010009H;      (* text, no memory for TmpRas *)
  415.   bltBitMap     * = 8201000AH;      (* BltBitMap, no memory *)
  416.   regionMemory  * = 8201000BH;      (* regions, memory not available *)
  417.   makeVPort     * = 82010030H;      (* MakeVPort, no memory *)
  418.   gfxNewError   * = 0200000CH;
  419.   gfxFreeError  * = 0200000DH;
  420.  
  421.   gfxNoLCM      * = 82011234H;      (* emergency memory not available *)
  422.  
  423.   obsoleteFont  * = 02000401H;      (* unsupported font description used *)
  424.  
  425. (* ------ layers.library *)
  426.   anLayersLib   * = 03000000H;
  427.   layersNoMem   * = 83010000H;      (* layers out of memory *)
  428.  
  429. (* ------ intuition.library *)
  430.   anIntuition  * = 04000000H;
  431.   gadgetType   * = 84000001H;      (* unknown gadget type *)
  432.   badGadget    * = 04000001H;      (* Recovery form of GadgetType *)
  433.   createPort   * = 84010002H;      (* create port, no memory *)
  434.   itemAlloc    * = 04010003H;      (* item plane alloc, no memory *)
  435.   subAlloc     * = 04010004H;      (* sub alloc, no memory *)
  436.   planeAlloc   * = 84010005H;      (* plane alloc, no memory *)
  437.   itemBoxTop   * = 84000006H;      (* item box top < RelZero *)
  438.   openScreen   * = 84010007H;      (* open screen, no memory *)
  439.   openScrnRast * = 84010008H;      (* open screen, raster alloc, no memory *)
  440.   sysScrnType  * = 84000009H;      (* open sys screen, unknown type *)
  441.   addSWGadget  * = 8401000AH;      (* add SW gadgets, no memory *)
  442.   openWindow   * = 8401000BH;      (* open window, no memory *)
  443.   badState     * = 8400000CH;      (* Bad State Return entering Intuition *)
  444.   badMessage   * = 8400000DH;      (* Bad Message received by IDCMP *)
  445.   weirdEcho    * = 8400000EH;      (* Weird echo causing incomprehension *)
  446.   noConsole    * = 8400000FH;      (* couldn't open the Console Device *)
  447.   noISem       * = 004000010H;     (* Intuition skipped obtaining a sem *)
  448.   iSemOrder    * = 004000011H;     (* Intuition obtained a sem in bad order *)
  449.  
  450. (* ------ math.library *)
  451.   anMathLib     * = 05000000H;
  452.  
  453. (* ------ dos.library *)
  454.   anDosLib     * = 07000000H;
  455.   startMem     * = 07010001H; (* no memory at startup *)
  456.   endTask      * = 07000002H; (* EndTask didn't *)
  457.   qPktFail     * = 07000003H; (* Qpkt failure *)
  458.   asyncPkt     * = 07000004H; (* Unexpected packet received *)
  459.   freeVec      * = 07000005H; (* Freevec failed *)
  460.   diskBlkSeq   * = 07000006H; (* Disk block sequence error *)
  461.   bitMap       * = 07000007H; (* Bitmap corrupt *)
  462.   keyFree      * = 07000008H; (* Key already free *)
  463.   badChkSum    * = 07000009H; (* Invalid checksum *)
  464.   diskError    * = 0700000AH; (* Disk Error *)
  465.   keyRange     * = 0700000BH; (* Key out of range *)
  466.   badOverlay   * = 0700000CH; (* Bad overlay *)
  467.   badInitFunc  * = 0700000DH; (* Invalid init packet for cli/shell *)
  468.   fileReclosed * = 0700000EH; (* A filehandle was closed more than once *)
  469.  
  470. (* ------ ramlib.library *)
  471.   anRAMLib    * = 08000000H;
  472.   badSegList  * = 08000001H;      (* no overlays in library seglists *)
  473.  
  474. (* ------ icon.library *)
  475.   anIconLib     * = 09000000H;
  476.  
  477. (* ------ expansion.library *)
  478.   anExpansionLib   * = 0A000000H;
  479.   badExpansionFree * = 0A000001H; (* freeed free region *)
  480.  
  481. (* ------ diskfont.library *)
  482.   anDiskfontLib * = 0B000000H;
  483.  
  484. (* ------ audio.device *)
  485.   anAudioDev    * = 10000000H;
  486.  
  487. (* ------ console.device *)
  488.   anConsoleDev  * = 11000000H;
  489.   noWindow      * = 11000001H;      (* Console can't open initial window *)
  490.  
  491. (* ------ gameport.device *)
  492.   anGamePortDev * = 12000000H;
  493.  
  494. (* ------ keyboard.device *)
  495.   anKeyboardDev * = 13000000H;
  496.  
  497. (* ------ trackdisk.device *)
  498.   anTrackDiskDev * = 14000000H;
  499.   tdCalibSeek    * = 14000001H;      (* calibrate: seek error *)
  500.   tdDelay        * = 14000002H;      (* delay: error on timer wait *)
  501.  
  502. (* ------ timer.device *)
  503.   anTimerDev    * = 15000000H;
  504.   tmBadReq      * = 15000001H; (* bad request *)
  505.   tmBadSupply   * = 15000002H; (* power supply -- no 50/60Hz ticks *)
  506.  
  507. (* ------ cia.resource *)
  508.   anCIARsrc     * = 20000000H;
  509.  
  510. (* ------ disk.resource *)
  511.   anDiskRsrc    * = 21000000H;
  512.   drHasDisk     * = 21000001H;      (* get unit: already has disk *)
  513.   drIntNoAct    * = 21000002H;      (* interrupt: no active unit *)
  514.  
  515. (* ------ misc.resource *)
  516.   anMiscRsrc    * = 22000000H;
  517.  
  518. (* ------ bootstrap *)
  519.   anBootStrap   * = 30000000H;
  520.   bootError     * = 30000001H;      (* boot code returned an error *)
  521.  
  522. (* ------ Workbench *)
  523.   anWorkbench                   * = 31000000H;
  524.   noFonts                       * = 0B1000001H;
  525.   wbBadStartupMsg1              * = 31000001H;
  526.   wbBadStartupMsg2              * = 31000002H;
  527.   wbBadIOMsg                    * = 31000003H;
  528.   wbReLayoutToolMenu            * = 0B1010009H;
  529.  
  530.   (* The following are in the V37 includes, but not the V40 *)
  531.  
  532.   wbInitPotionAllocDrawer     * = 0B1010004H;
  533.   wbCreateWBMenusCreateMenus1 * = 0B1010005H;
  534.   wbCreateWBMenusCreateMenus2 * = 0B1010006H;
  535.   wbLayoutWBMenusLayoutMenus  * = 0B1010007H;
  536.   wbAddToolMenuItem           * = 0B1010008H;
  537.   wbinitTimer                 * = 0B101000AH;
  538.   wbInitLayerDemon            * = 0B101000BH;
  539.   wbinitWbGels                * = 0B101000CH;
  540.   wbInitScreenAndWindows1     * = 0B101000DH;
  541.   wbInitScreenAndWindows2     * = 0B101000EH;
  542.   wbInitScreenAndWindows3     * = 0B101000FH;
  543.   wbMAlloc                    * = 0B1010010H;
  544.  
  545. (* ------ DiskCopy *)
  546.   anDiskCopy    * = 32000000H;
  547.  
  548. (* ------ toolkit for Intuition *)
  549.   anGadTools    * = 33000000H;
  550.  
  551. (* ------ System utility library *)
  552.   anUtilityLib  * = 34000000H;
  553.  
  554. (* ------ For use by any application that needs it *)
  555.   anUnknown     * = 35000000H;
  556.  
  557. (*
  558. **      $VER: errors.h 39.0 (15.10.91)
  559. **
  560. **      Standard Device IO Errors (returned in ioError)
  561. *)
  562.  
  563.   openFail  * = -1; (* device/unit failed to open *)
  564.   aborted   * = -2; (* request terminated early [after AbortIO()] *)
  565.   noCmd     * = -3; (* command not supported by device *)
  566.   badLength * = -4; (* not a valid length (usually ioLENGTH) *)
  567.   badAddress* = -5; (* invalid address (misaligned or bad range) *)
  568.   unitBusy  * = -6; (* device opens ok, but requested unit is busy *)
  569.   selfTest  * = -7; (* hardware failed self-test *)
  570.  
  571.  
  572. (*
  573. **      $VER: resident.h 39.0 (15.10.91)
  574. **
  575. **      Resident/ROMTag stuff.  Used to identify and initialize code modules.
  576. *)
  577.  
  578.  
  579. TYPE
  580.  
  581.   Resident* = RECORD
  582.     matchWord* : UWORD;          (* word to match on (ILLEGAL)       *)
  583.     matchTag*  : ResidentPtr;    (* pointer to the above             *)
  584.     endSkip*   : APTR;           (* address to continue scan         *)
  585.     flags*     : s.SET8;           (* various tag flags                *)
  586.     version*   : SHORTINT;          (* release version number           *)
  587.     type*      : SHORTINT;          (* type of module (ntXXXXXX)        *)
  588.     pri*       : SHORTINT;       (* initialization priority          *)
  589.     name*      : LSTRPTR;         (* pointer to node name             *)
  590.     idString*  : LSTRPTR;         (* pointer to identification string *)
  591.     init*      : APTR;           (* pointer to init code             *)
  592.   END; (* Resident *)
  593.  
  594. CONST
  595.  
  596.   matchWord  * = 4AFCH;  (* The 68000 "ILLEGAL" instruction *)
  597.  
  598.   autoInit   * = 7;  (* Resident.init points to data structure *)
  599.   afterDos   * = 2;
  600.   singleTask * = 1;
  601.   coldStart  * = 0;
  602.  
  603.   never      * = {};
  604.  
  605. (*
  606. **      $VER: memory.h 39.3 (21.5.92)
  607. **
  608. **      Definitions and structures used by the memory allocation system
  609. *)
  610.  
  611. TYPE
  612.  
  613. (****** MemChunk ****************************************************)
  614.  
  615.   MemChunk* = RECORD
  616.     next*  : MemChunkPtr;  (* pointer to next chunk *)
  617.     bytes* : ULONG;        (* chunk byte size       *)
  618.   END; (* MemChunk *)
  619.  
  620.  
  621. (****** MemHeader ***************************************************)
  622.  
  623.   MemHeader* = RECORD (NodeBase)
  624.     node*       : Node;
  625.     attributes* : s.SET16;        (* characteristics of this region *)
  626.     first*      : MemChunkPtr;  (* first free region              *)
  627.     lower*      : APTR;         (* lower memory bound             *)
  628.     upper*      : APTR;         (* upper memory bound+1           *)
  629.     free*       : ULONG;        (* total number of free bytes     *)
  630.   END; (* MemHeader *)
  631.  
  632.  
  633. (****** MemEntry ****************************************************)
  634.  
  635.   MemEntry* = RECORD
  636.     addr *   : APTR;           (* the address of this memory region *)
  637.  (** reqs *   : s.SET32;        (* the AllocMem requirements         *)
  638.   *
  639.   * This occupies the same space as addr (a C union).  Access via:
  640.   *   SYS.VAL (s.SET32, MemEntry.addr)
  641.   *)
  642.     length * : ULONG;          (* the length of this memory region  *)
  643.   END; (* MemEntry *)
  644.  
  645. (****** MemList *****************************************************)
  646.  
  647. (* Note: SIZE (MemList) includes the size of the first MemEntry!
  648.    No it doesn't !!  This is *Oberon*, not C !! *)
  649.  
  650.   MemList* = RECORD (NodeBase)
  651.     node       * : Node;
  652.     numEntries * : UWORD;             (* number of entries in this struct *)
  653.   (*me         * : ARRAY OF MemEntry; (* the first entry      *)*)
  654.   END; (* MemList *)
  655.  
  656. CONST
  657.  
  658. (* ----- Memory Requirement Types ---------------------------*)
  659. (* ----- See the AllocMem() documentation for details--------*)
  660.  
  661.   any         * = {};   (* Any type of memory will do *)
  662.   public      * = 0;
  663.   chip        * = 1;
  664.   fast        * = 2;
  665.   local       * = 8;    (* Memory that does not go away at RESET *)
  666.   mem24BitDMA * = 9;    (* DMAable memory within 24 bits of address *)
  667.   kick        * = 10;   (* Memory that can be used for KickTags *)
  668.  
  669.   memClear    * = 16;   (* AllocMem: NULL out area before return *)
  670.   largest     * = 17;   (* AvailMem: return the largest chunk size *)
  671.   reverse     * = 18;   (* AllocMem: allocate from the top down *)
  672.   total       * = 19;   (* AvailMem: return total size of memory *)
  673.  
  674.   noExpunge* = 31;   (*AllocMem: Do not cause expunge on failure *)
  675.  
  676. (* ----- Current alignment rules for memory blocks (may increase) -----*)
  677.   blockSize  * = 8;
  678.   blockMask  * = (blockSize-1);
  679.  
  680. TYPE
  681.  
  682. (****** MemHandlerData **********************************************)
  683. (* Note:  This structure is *READ ONLY* and only EXEC can create it!*)
  684.   MemHandlerData * = RECORD
  685.     requestSize  - :  ULONG;  (* Requested allocation size *)
  686.     requestFlags - :  s.SET32;(* Requested allocation flags *)
  687.     flags        - :  s.SET32;(* Flags (see below) *)
  688.   END;
  689.  
  690. CONST
  691.  
  692.   recycle * = 0;      (* 0==First time, 1==recycle *)
  693.  
  694. (****** Low Memory handler return values ***************************)
  695.   didNothing * =  0;  (* Nothing we could do... *)
  696.   allDone    * = -1;  (* We did all we could do *)
  697.   tryAgain   * =  1;  (* We did some, try the allocation again *)
  698.  
  699. (*
  700. **      $VER: tasks.h 39.3 (18.9.92)
  701. **
  702. **      Task Control Block, Singals, and Task flags.
  703. *)
  704.  
  705. TYPE
  706.  
  707.   TaskBase *= RECORD (NodeBase) END;
  708.   TaskBasePtr *= POINTER TO TaskBase;
  709.  
  710. (* Please use Exec functions to modify task structure fields, where available.
  711.  *)
  712.   Task * = RECORD (TaskBase)
  713.     node*       : Node;
  714.     flags*      : s.SET8;
  715.     state*      : s.SET8;
  716.     idNestCnt*  : SHORTINT;   (* intr disabled nesting*)
  717.     tdNestCnt*  : SHORTINT;   (* task disabled nesting*)
  718.     sigAlloc*   : s.SET32;    (* sigs allocated *)
  719.     sigWait*    : s.SET32;    (* sigs we are waiting for *)
  720.     sigRecvd*   : s.SET32;    (* sigs we have received *)
  721.     sigExcept*  : s.SET32;    (* sigs we will take excepts for *)
  722.     trapAlloc*  : s.SET16;      (* traps allocated *)
  723.     trapAble*   : s.SET16;      (* traps enabled *)
  724.     exceptData* : APTR;       (* points to except data *)
  725.     exceptCode* : PROC;       (* points to except code *)
  726.     trapData*   : APTR;       (* points to trap code *)
  727.     trapCode*   : PROC;       (* points to trap data *)
  728.     spReg*      : APTR;       (* stack pointer        *)
  729.     spLower*    : APTR;       (* stack lower bound    *)
  730.     spUpper*    : APTR;       (* stack upper bound + 2*)
  731.     switch*     : PROC;       (* task losing CPU    *)
  732.     launch*     : PROC;       (* task getting CPU  *)
  733.     memEntry*   : List;       (* Allocated memory. Freed by RemTask() *)
  734.     userData*   : APTR;       (* For use by the task; no restrictions! *)
  735.   END; (* Task *)
  736.  
  737. (*
  738.  * Stack swap structure as passed to StackSwap()
  739.  *)
  740.   StackSwapStruct* = RECORD
  741.     lower*   : APTR;    (* Lowest byte of stack *)
  742.     upper*   : ULONG;   (* Upper end of stack (size + Lowest) *)
  743.     pointer* : APTR;    (* Stack pointer at switch point *)
  744.   END; (* StackSwapStruct *)
  745.  
  746. CONST
  747.  
  748. (* ----- Flag Bits ------------------------------------------*)
  749.   procTime    * = 0;
  750.   eTask       * = 3;
  751.   stackChk    * = 4;
  752.   exception   * = 5;
  753.   switch      * = 6;
  754.   launch      * = 7;
  755.  
  756. (* ----- Task States ----------------------------------------*)
  757.   inval       * = 0;
  758.   added       * = 1;
  759.   run         * = 2;
  760.   ready       * = 3;
  761.   wait        * = 4;
  762.   except      * = 5;
  763.   removed     * = 6;
  764.  
  765. (* ----- Predefined Signals -------------------------------------*)
  766.   sigAbort     * = 0;
  767.   sigChild     * = 1;
  768.   sigBlit      * = 4;       (* Note: same as SINGLE *)
  769.   sigSingle    * = 4;       (* Note: same as BLIT *)
  770.   sigIntuition * = 5;
  771.   sigNet       * = 7;
  772.   sigDos       * = 8;
  773.  
  774. (*
  775. **      $VER: ports.h 39.0 (15.10.91)
  776. **
  777. **      Message ports and Messages.
  778. *)
  779.  
  780. TYPE
  781.  
  782.   MsgPortBase *= RECORD (NodeBase) END;
  783.   MsgPortBasePtr *= POINTER TO MsgPortBase;
  784.  
  785. (****** MsgPort *****************************************************)
  786.  
  787.   MsgPort * = RECORD (MsgPortBase)
  788.     node*    : Node;
  789.     flags*   : SHORTINT;
  790.     sigBit*  : SHORTINT;(* signal bit number    *)
  791.     sigTask* : TaskPtr; (* object to be signalled *)
  792.     msgList* : List;    (* message linked list  *)
  793.   END; (* MsgPort *)
  794.  
  795.   MsgPortSoftInt* = RECORD (MsgPortBase)
  796.     node*    : Node;
  797.     flags*   : SHORTINT;
  798.     sigBit*  : SHORTINT;     (* signal bit number    *)
  799.     softInt* : InterruptPtr; (* object to be signalled *)
  800.     msgList* : List;         (* message linked list  *)
  801.   END; (* MsgPortSoftInt *)
  802.  
  803. CONST
  804.  
  805. (* MsgPort.flags: Port arrival actions (PutMsg) *)
  806.   signal    * = 0;     (* Signal task in mpSigTask *)
  807.   softint   * = 1;     (* Signal SoftInt in mpsoftint/mpSigTask *)
  808.   ignore    * = 2;     (* Ignore arrival *)
  809.  
  810.  
  811. TYPE
  812.  
  813.   MessageBase *= RECORD (NodeBase) END;
  814.   MessageBasePtr *= POINTER TO MessageBase;
  815.  
  816. (****** Message *****************************************************)
  817.  
  818.   Message * = RECORD (MessageBase)
  819.     node*      : Node;
  820.     replyPort* : MsgPortPtr;  (* message reply port *)
  821.     length*    : UWORD;       (* total message length, in bytes *)
  822.                               (* (include the size of the Message *)
  823.                               (* structure in the length) *)
  824.   END; (* Message *)
  825.  
  826. (*
  827. **      $VER: interrupts.h 39.1 (18.9.92)
  828. **
  829. **      Callback structures used by hardware & software interrupts
  830. *)
  831.  
  832. TYPE
  833.  
  834.   Interrupt * = RECORD (NodeBase)
  835.     node* : Node;
  836.     data* : APTR;                (* server data segment  *)
  837.     code* : PROC;                (* server code entry    *)
  838.   END; (* Interrupt *)
  839.  
  840.  
  841.   IntVector * = RECORD            (* For EXEC use ONLY! *)
  842.     data* : APTR;
  843.     code* : PROC;
  844.     node* : NodePtr;
  845.   END; (* IntVector *)
  846.  
  847.  
  848.   SoftIntList * = RECORD (CommonList)   (* For EXEC use ONLY! *)
  849.     list* : List;
  850.     pad*  : UWORD;
  851.   END; (* SoftIntList *)
  852.  
  853. CONST
  854.  
  855. (* this is a fake INT definition, used only for AddIntServer and the like *)
  856.   nmi * = 15;
  857.  
  858. (*
  859. **      $VER: semaphores.h 39.1 (7.2.92)
  860. **
  861. **      Definitions for locking functions.
  862. *)
  863.  
  864. TYPE
  865.  
  866. (****** SignalSemaphore *********************************************)
  867.  
  868. (* Private structure used by ObtainSemaphore() *)
  869.   SemaphoreRequest = RECORD (MinNodeBase)
  870.     link   - : MinNode;
  871.     waiter - : TaskPtr;
  872.   END; (* SemaphoreRequest *)
  873.  
  874. (* Signal Semaphore data structure *)
  875.   SignalSemaphoreBase *= RECORD (NodeBase) END;
  876.   SignalSemaphoreBasePtr *= POINTER TO SignalSemaphoreBase;
  877.  
  878.   SignalSemaphore * = RECORD (SignalSemaphoreBase)
  879.     link*         : Node;
  880.     nestCount*    : INTEGER;
  881.     waitQueue*    : MinList;
  882.     multipleLink- : SemaphoreRequest;
  883.     owner*        : TaskPtr;
  884.     queueCount*   : INTEGER;
  885.   END; (* SignalSemaphore *)
  886.  
  887. (****** Semaphore procure message (for use in V39 Procure/Vacate ****)
  888.   SemaphoreMessageBase *= RECORD (MessageBase) END;
  889.   SemaphoreMessageBasePtr *= POINTER TO SemaphoreMessageBase;
  890.  
  891.   SemaphoreMessage * = RECORD (SemaphoreMessageBase)
  892.     semaphore * :  SignalSemaphorePtr;
  893.   END;
  894.  
  895. CONST
  896.  
  897.   shared    * = 1;
  898.   exclusive * = 0;
  899.  
  900. TYPE
  901.  
  902.   MsgPortLockMsg * = RECORD (MsgPortBase)
  903.     node   * : Node;
  904.     flags  * : SHORTINT;
  905.     sigBit * : SHORTINT;     (* signal bit number    *)
  906.     lockMsg* : MessagePtr;   (* object to be signalled *) (* may be other type [hG] *)
  907.     msgList* : List;         (* message linked list  *)
  908.   END;
  909.  
  910. TYPE
  911.  
  912. (****** Semaphore (Old Procure/Vacate type, not reliable) ***********)
  913.  
  914.   Semaphore* = RECORD (MsgPortBase) (* Do not use these semaphores! *)
  915.     msgPort* : MsgPort;
  916.     bids*    : INTEGER;
  917.   END; (* Semaphore *)
  918.  
  919.  
  920. (*
  921. **      $VER: libraries.h 39.2 (10.4.92)
  922. **
  923. **      Definitions for use when creating or using Exec libraries
  924. *)
  925.  
  926.  
  927. CONST
  928.  
  929. (* ------ Special Constants ---------------------------------------*)
  930.   vectSize   * = 6;       (* Each library entry takes 6 bytes *)
  931.   reserved   * = 4;       (* Exec reserves the first 4 vectors *)
  932.   base       * = -vectSize;
  933.   userDef    * = base-reserved*vectSize;
  934.   nonStd     * = userDef;
  935.  
  936. (* ------ Standard Functions --------------------------------------*)
  937.   open       * = -6;
  938.   close      * = -12;
  939.   expunge    * = -18;
  940.   extFunc    * = -24;   (* for future expansion *)
  941.  
  942. TYPE
  943.  
  944. (* ------ Library Base Structure ----------------------------------*)
  945. (* Also used for Devices and some Resources *)
  946.   LibraryBase *= RECORD (NodeBase) END;
  947.   LibraryBasePtr *= POINTER TO LibraryBase;
  948.  
  949.   Library * = RECORD (LibraryBase)
  950.     node*     : Node;
  951.     flags*    : s.SET8;
  952.     pad*      : SHORTINT;
  953.     negSize*  : UWORD;          (* number of bytes before library *)
  954.     posSize*  : UWORD;          (* number of bytes after library *)
  955.     version*  : UWORD;          (* major *)
  956.     revision* : UWORD;          (* minor *)
  957.     idString* : LSTRPTR;        (* ASCII identification *)
  958.     sum*      : ULONG;          (* the checksum itself *)
  959.     openCnt*  : UWORD;          (* number of current opens *)
  960.   END; (* Library *)      (* Warning: size is not a longword multiple! *)
  961.  
  962. CONST
  963.  
  964. (* Flags bit definitions (all others are system reserved) *)
  965.   summing   * = 0;      (* we are currently checksumming *)
  966.   changed   * = 1;      (* we have just changed the lib *)
  967.   sumUsed   * = 2;      (* set if we should bother to sum *)
  968.   delExp    * = 3;      (* delayed expunge *)
  969.  
  970.  
  971. (*
  972. **      $VER: io.h 39.0 (15.10.91)
  973. **
  974. **      Message structures used for device communication
  975. *)
  976.  
  977.  
  978. TYPE
  979.  
  980.   IORequestBase *= RECORD (MessageBase) END;
  981.   IORequestBasePtr *= POINTER TO IORequestBase;
  982.  
  983.   IORequest * = RECORD (IORequestBase)
  984.     message* : Message;
  985.     device*  : DevicePtr;  (* device node pointer  *)
  986.     unit*    : UnitPtr;    (* unit (driver private)*)
  987.     command* : UWORD;      (* device command *)
  988.     flags*   : s.SET8;
  989.     error*   : SHORTINT;   (* error or warning num *)
  990.   END; (* IORequest *)
  991.  
  992.   IOStdReq * = RECORD (IORequestBase)
  993.     message* : Message;
  994.     device*  : DevicePtr;  (* device node pointer  *)
  995.     unit*    : UnitPtr;    (* unit (driver private)*)
  996.     command* : UWORD;      (* device command *)
  997.     flags*   : s.SET8;
  998.     error*   : SHORTINT;   (* error or warning num *)
  999.     actual*  : ULONG;      (* actual number of bytes transferred *)
  1000.     length*  : ULONG;      (* requested number bytes transferred*)
  1001.     data*    : APTR;       (* points to data area *)
  1002.     offset*  : ULONG;      (* offset for block structured devices *)
  1003.   END; (* IOStdReq *)
  1004.  
  1005. CONST
  1006.  
  1007. (* library vector offsets for device reserved vectors *)
  1008.   beginIO    * = -30;
  1009.   abortIO    * = -36;
  1010.  
  1011. (* ioFlags defined bits *)
  1012.   quick      * = 0;
  1013.  
  1014.  
  1015.   invalid    * = 0;
  1016.   reset      * = 1;
  1017.   read       * = 2;
  1018.   write      * = 3;
  1019.   update     * = 4;
  1020.   clear      * = 5;
  1021.   stop       * = 6;
  1022.   start      * = 7;
  1023.   flush      * = 8;
  1024.  
  1025.   nonstd     * = 9;
  1026.  
  1027. (*
  1028. **      $VER: devices.h 39.0 (15.10.91)
  1029. **
  1030. **      Include file for use by Exec device drivers
  1031. *)
  1032.  
  1033. TYPE
  1034.  
  1035. (****** Device ******************************************************)
  1036.  
  1037.   DeviceBase *= RECORD (LibraryBase) END;
  1038.   DeviceBasePtr *= POINTER TO DeviceBase;
  1039.  
  1040.   Device * = RECORD (DeviceBase) library * : Library END;
  1041.  
  1042.  
  1043. (****** Unit ********************************************************)
  1044.  
  1045.   UnitBase *= RECORD (MsgPortBase) END;
  1046.   UnitBasePtr *= POINTER TO UnitBase;
  1047.  
  1048.   Unit * = RECORD (UnitBase)
  1049.     msgPort* : MsgPort;  (* queue for unprocessed messages *)
  1050.                          (* instance of msgport is recommended *)
  1051.     flags*   : s.SET8;
  1052.     pad*     : BYTE;
  1053.     openCnt* : UWORD;    (* number of active opens *)
  1054.   END; (* Unit *)
  1055.  
  1056.  
  1057. CONST
  1058.  
  1059.   active   * = 0;
  1060.   inTask   * = 1;
  1061.  
  1062.  
  1063. (*
  1064. **      $VER: execbase.h 39.6 (18.1.93)
  1065. **
  1066. **      Definition of the exec.library base structure.
  1067. *)
  1068.  
  1069. TYPE
  1070.  
  1071. (* Definition of the Exec library base structure (pointed to by location 4).
  1072. ** Most fields are not to be viewed or modified by user programs.  Use
  1073. ** extreme caution.
  1074. *)
  1075.   ExecBase* = RECORD (LibraryBase)
  1076.     libNode*         : Library; (* Standard library node *)
  1077.  
  1078. (******** Static System Variables ********)
  1079.  
  1080.     softVer*         : UWORD;   (* kickstart release number (obs.) *)
  1081.     lowMemChkSum*    : INTEGER; (* checksum of 68000 trap vectors *)
  1082.     chkBase*         : ULONG;   (* system base pointer complement *)
  1083.     coldCapture*     : APTR;    (* coldstart soft capture vector *)
  1084.     coolCapture*     : APTR;    (* coolstart soft capture vector *)
  1085.     warmCapture*     : APTR;    (* warmstart soft capture vector *)
  1086.     sysStkUpper*     : APTR;    (* system stack base   (upper bound) *)
  1087.     sysStkLower*     : APTR;    (* top of system stack (lower bound) *)
  1088.     maxLocMem*       : APTR;    (* top of chip memory *)
  1089.     debugEntry*      : APTR;    (* global debugger entry point *)
  1090.     debugData*       : APTR;    (* global debugger data segment *)
  1091.     alertData*       : APTR;    (* alert data segment *)
  1092.     maxExtMem*       : APTR;    (* top of extended mem, or null if none *)
  1093.  
  1094.     chkSum*          : UWORD; (* for all of the above (minus 2) *)
  1095.  
  1096. (****** Interrupt Related ***************************************)
  1097.  
  1098.     intVects         : ARRAY 16 OF IntVector;
  1099.  
  1100. (****** Dynamic System Variables *************************************)
  1101.  
  1102.     thisTask*        : TaskPtr; (* pointer to current task (readable) *)
  1103.  
  1104.     idleCount*       : ULONG;   (* idle counter *)
  1105.     dispCount*       : ULONG;   (* dispatch counter *)
  1106.     quantum*         : UWORD;   (* time slice quantum *)
  1107.     elapsed*         : UWORD;   (* current quantum ticks *)
  1108.     sysFlags*        : s.SET16; (* misc internal system flags *)
  1109.     idNestCnt*       : SHORTINT;    (* interrupt disable nesting count *)
  1110.     tdNestCnt*       : SHORTINT;    (* task disable nesting count *)
  1111.  
  1112.     attnFlags*       : s.SET16; (* special attention flags (readable) *)
  1113.  
  1114.     attnResched*     : UWORD;   (* rescheduling attention *)
  1115.     resModules*      : APTR;    (* resident module array pointer *)
  1116.     taskTrapCode*    : PROC;
  1117.     taskExceptCode*  : PROC;
  1118.     taskExitCode*    : PROC;
  1119.     taskSigAlloc*    : s.SET32;
  1120.     taskTrapAlloc*   : s.SET16;
  1121.  
  1122.  
  1123. (****** System Lists (private!) ********************************)
  1124.  
  1125.     memList-         : List;
  1126.     resourceList-    : List;
  1127.     deviceList-      : List;
  1128.     intrList-        : List;
  1129.     libList-         : List;
  1130.     portList-        : List;
  1131.     taskReady-       : List;
  1132.     taskWait-        : List;
  1133.  
  1134.     softInts         : ARRAY 5 OF SoftIntList;
  1135.  
  1136. (****** Other Globals *******************************************)
  1137.  
  1138.     lastAlert-       : ARRAY 4 OF LONGINT;
  1139.  
  1140.     (* these next two variables are provided to allow
  1141.     ** system developers to have a rough idea of the
  1142.     ** period of two externally controlled signals --
  1143.     ** the time between vertical blank interrupts and the
  1144.     ** external line rate (which is counted by CIA A's
  1145.     ** "time of day" clock).  In general these values
  1146.     ** will be 50 or 60, and may or may not track each
  1147.     ** other.  These values replace the obsolete afbPAL
  1148.     ** and afb50HZ flags.
  1149.     *)
  1150.     vblankFrequency-      : SHORTINT;   (* (readable) *)
  1151.     powerSupplyFrequency- : SHORTINT;   (* (readable) *)
  1152.  
  1153.     semaphoreList-   : List;
  1154.  
  1155.     (* these next two are to be able to kickstart into user ram.
  1156.     ** KickMemPtr holds a singly linked list of MemLists which
  1157.     ** will be removed from the memory list via AllocAbs.  If
  1158.     ** all the AllocAbs's succeeded, then the KickTagPtr will
  1159.     ** be added to the rom tag list.
  1160.     *)
  1161.     kickMemPtr*      : APTR;   (* ptr to queue of mem lists *)
  1162.     kickTagPtr*      : APTR;   (* ptr to rom tag queue *)
  1163.     kickCheckSum*    : APTR;   (* checksum for mem and tags *)
  1164.  
  1165. (****** V36 Exec additions start here **************************************)
  1166.  
  1167.     pad0             : UWORD;
  1168.     launchPoint      : ULONG;  (* Private to Launch/Switch *)
  1169.     ramLibPrivate    : APTR;
  1170.     (* The next ULONG contains the system "E" clock frequency,
  1171.     ** expressed in Hertz.  The E clock is used as a timebase for
  1172.     ** the Amiga's 8520 I/O chips. (E is connected to "02").
  1173.     ** Typical values are 715909 for NTSC, or 709379 for PAL.
  1174.     *)
  1175.     eClockFrequency- : ULONG;     (* (readable) *)
  1176.     cacheControl     : APTR;      (* Private to CacheControl calls *)
  1177.     taskID*          : ULONG;     (* Next available task ID *)
  1178.  
  1179.     reserved1*       : ARRAY 5 OF ULONG;
  1180.  
  1181.     mmuLock          : APTR;      (* private *)
  1182.  
  1183.     reserved2*       : ARRAY 3 OF ULONG;
  1184.  
  1185. (****** V39 Exec additions start here **************************************)
  1186.  
  1187.         (* The following list and data element are used
  1188.          * for V39 exec's low memory handler...
  1189.          *)
  1190.     memHandlers*     :  MinList;  (* The handler list *)
  1191.     memHandler       :  APTR;     (* Private! handler pointer *)
  1192.   END; (* ExecBase *)
  1193.  
  1194.  
  1195. CONST
  1196.  
  1197. (****** Bit defines for AttnFlags (see above) ******************************)
  1198.  
  1199. (*  Processors and Co-processors: *)
  1200.   m68010      * = 0;       (* also set for 68020 *)
  1201.   m68020      * = 1;       (* also set for 68030 *)
  1202.   m68030      * = 2;       (* also set for 68040 *)
  1203.   m68040      * = 3;
  1204.   m68881      * = 4;       (* also set for 68882 *)
  1205.   m68882      * = 5;
  1206.   mFPU40      * = 6;       (* Set if 68040 FPU *)
  1207. (*
  1208.  * The mFPU40 bit is set when a working 68040 FPU
  1209.  * is in the system.  If this bit is set and both the
  1210.  * m68881 and m68882 bits are not set, then the 68040
  1211.  * math emulation code has not been loaded and only 68040
  1212.  * FPU instructions are available.  This bit is valid *ONLY*
  1213.  * if the m68040 bit is set.
  1214.  *)
  1215.  
  1216. (****** Selected flag definitions for Cache manipulation calls **********)
  1217.  
  1218.   enableI      * = 0;  (* Enable instruction cache *)
  1219.   freezeI      * = 1;  (* Freeze instruction cache *)
  1220.   clearI       * = 3;  (* Clear instruction cache  *)
  1221.   ibe          * = 4;  (* Instruction burst enable *)
  1222.   enableD      * = 8;  (* 68030 Enable data cache  *)
  1223.   freezeD      * = 9;  (* 68030 Freeze data cache  *)
  1224.   clearD       * = 11; (* 68030 Clear data cache   *)
  1225.   dbe          * = 12; (* 68030 Data burst enable *)
  1226.   writeAllocate* = 13; (* 68030 Write-Allocate mode
  1227.                           (must always be set!)    *)
  1228.   enableE      * = 30; (* Master enable for external caches *)
  1229.                        (* External caches should track the *)
  1230.                        (* state of the internal caches *)
  1231.                        (* such that they do not cache anything *)
  1232.                        (* that the internal cache turned off *)
  1233.                        (* for. *)
  1234.   copyBack     * = 31; (* Master enable for copyback caches *)
  1235.  
  1236.   dmaContinue      * = 1;  (* Continuation flag for CachePreDMA *)
  1237.   dmaNoModify      * = 2;  (* Set if DMA does not update memory *)
  1238.   dmaReadFromRAM   * = 3;  (* Set if DMA goes *FROM* RAM to device *)
  1239.  
  1240. (**-- Library base pointer ---------------------------------------------*)
  1241.  
  1242. CONST
  1243.  
  1244.   absExecBase = 4;
  1245.  
  1246. VAR
  1247.  
  1248.   exec*, SysBase* : ExecBasePtr;
  1249.  
  1250.  
  1251. (**-- Library functions ------------------------------------------------*)
  1252.  
  1253. (* ------misc --------------------------------------------------------- *)
  1254.  
  1255. PROCEDURE Supervisor* [SysBase,-30]
  1256.   ( userFunction [13] : PROC )
  1257.   : APTR;
  1258.  
  1259. (* ------special patchable hooks to internal exec activity ------------ *)
  1260.  
  1261. (* ------module creation ---------------------------------------------- *)
  1262.  
  1263. PROCEDURE InitCode* [SysBase,-72]
  1264.   ( startClass [0] : s.SET8;
  1265.     version    [1] : ULONG );
  1266. PROCEDURE InitStruct* [SysBase,-78]
  1267.   ( initTable [9] : APTR;
  1268.     memory   [10] : APTR;
  1269.     size      [0] : ULONG );
  1270. PROCEDURE MakeLibrary* [SysBase,-84]
  1271.   ( funcInit   [8] : APTR;
  1272.     structInit [9] : APTR;
  1273.     libInit   [10] : PROC;
  1274.     dataSize   [0] : ULONG;
  1275.     segList    [1] : BPTR )
  1276.   : LibraryPtr;
  1277. PROCEDURE MakeFunctions* [SysBase,-90]
  1278.   ( target        [8] : APTR;
  1279.     functionArray [9] : APTR;
  1280.     funcDispBase [10] : APTR );
  1281. PROCEDURE FindResident* [SysBase,-96]
  1282.   ( name [9] : ARRAY OF CHAR )
  1283.   : ResidentPtr;
  1284. PROCEDURE InitResident* [SysBase,-102]
  1285.   ( resident [9] : ResidentPtr;
  1286.     segList  [1] : BPTR );
  1287.  
  1288. (* ------diagnostics -------------------------------------------------- *)
  1289.  
  1290. PROCEDURE Alert* [SysBase,-108]
  1291.   ( alertNum [7] : ULONG );
  1292. PROCEDURE Debug* [SysBase,-114]
  1293.   ( flags [0] : s.SET32 );
  1294.  
  1295. (* ------interrupts --------------------------------------------------- *)
  1296.  
  1297. PROCEDURE Disable* [SysBase,-120] ();
  1298. PROCEDURE Enable* [SysBase,-126] ();
  1299. PROCEDURE Forbid* [SysBase,-132] ();
  1300. PROCEDURE Permit* [SysBase,-138] ();
  1301. PROCEDURE SetSR* [SysBase,-144]
  1302.   ( newSR [0] : s.SET16;
  1303.     mask  [1] : s.SET16 )
  1304.   : s.SET16;
  1305. PROCEDURE SuperState* [SysBase,-150] ();
  1306. PROCEDURE UserState* [SysBase,-156]
  1307.   ( sysStack [0] : APTR );
  1308. PROCEDURE SetIntVector* [SysBase,-162]
  1309.   ( intNumber [0] : ULONG;
  1310.     interrupt [9] : InterruptPtr )
  1311.   : InterruptPtr;
  1312. PROCEDURE AddIntServer* [SysBase,-168]
  1313.   ( intNumber [0] : ULONG;
  1314.     interrupt [9] : InterruptPtr );
  1315. PROCEDURE RemIntServer* [SysBase,-174]
  1316.   ( intNumber [0] : ULONG;
  1317.     interrupt [9] : InterruptPtr );
  1318. PROCEDURE Cause* [SysBase,-180]
  1319.   ( interrupt [9] : InterruptPtr );
  1320.  
  1321. (* ------memory allocation -------------------------------------------- *)
  1322.  
  1323. PROCEDURE Allocate* [SysBase,-186]
  1324.   ( freeList [8] : MemHeaderPtr;
  1325.     byteSize [0] : ULONG )
  1326.   : APTR;
  1327. PROCEDURE Deallocate* [SysBase,-192]
  1328.   ( freeList    [8] : MemHeaderPtr;
  1329.     memoryBlock [9] : APTR;
  1330.     byteSize    [0] : ULONG );
  1331. PROCEDURE AllocMem* [SysBase,-198]
  1332.   ( byteSize     [0] : ULONG;
  1333.     requirements [1] : s.SET32 )
  1334.   : APTR;
  1335. PROCEDURE AllocAbs* [SysBase,-204]
  1336.   ( byteSize [0] : ULONG;
  1337.     location [1] : APTR )
  1338.   : APTR;
  1339. PROCEDURE FreeMem* [SysBase,-210]
  1340.   ( memoryBlock [9] : APTR;
  1341.     byteSize    [0] : ULONG );
  1342. PROCEDURE AvailMem* [SysBase,-216]
  1343.   ( requirements [1] : s.SET32 )
  1344.   : ULONG;
  1345. PROCEDURE AllocEntry* [SysBase,-222]
  1346.   ( entry [8] : APTR )
  1347.   : APTR;
  1348. PROCEDURE FreeEntry* [SysBase,-228]
  1349.   ( entry [8] : APTR );
  1350.  
  1351. (* ------lists -------------------------------------------------------- *)
  1352.  
  1353. PROCEDURE Insert* [SysBase,-234]
  1354.   ( VAR list [8] : CommonList;
  1355.     node     [9] : CommonNodePtr;
  1356.     pred    [10] : CommonNodePtr );
  1357. PROCEDURE AddHead* [SysBase,-240]
  1358.   ( VAR list [8] : CommonList;
  1359.     node     [9] : CommonNodePtr );
  1360. PROCEDURE AddTail* [SysBase,-246]
  1361.   ( VAR list [8] : CommonList;
  1362.     node     [9] : CommonNodePtr );
  1363. PROCEDURE Remove* [SysBase,-252]
  1364.   ( node [9] : CommonNodePtr );
  1365. PROCEDURE RemHead* [SysBase,-258]
  1366.   ( VAR list [8] : CommonList )
  1367.   : CommonNodePtr;
  1368. PROCEDURE RemTail* [SysBase,-264]
  1369.   ( VAR list [8] : CommonList )
  1370.   : CommonNodePtr;
  1371. PROCEDURE Enqueue* [SysBase,-270]
  1372.   ( VAR list [8] : CommonList;
  1373.     node     [9] : CommonNodePtr );
  1374. PROCEDURE FindName* [SysBase,-276]
  1375.   ( VAR list [8] : CommonList;
  1376.     name     [9] : ARRAY OF CHAR )
  1377.   : CommonNodePtr;
  1378.  
  1379. (* ------tasks -------------------------------------------------------- *)
  1380.  
  1381. PROCEDURE AddTask* [SysBase,-282]
  1382.   ( task     [9] : TaskBasePtr;
  1383.     initPC  [10] : PROC;
  1384.     finalPC [11] : APTR );
  1385. PROCEDURE RemTask* [SysBase,-288]
  1386.   ( task [9] : TaskBasePtr );
  1387. PROCEDURE FindTask* [SysBase,-294]
  1388.   ( name [9] : ARRAY OF CHAR )
  1389.   : TaskPtr;
  1390. PROCEDURE SetTaskPri* [SysBase,-300]
  1391.   ( task     [9] : TaskBasePtr;
  1392.     priority [0] : LONGINT )
  1393.   : SHORTINT;
  1394. PROCEDURE SetSignal* [SysBase,-306]
  1395.   ( newSignals [0] : s.SET32;
  1396.     signalSet  [1] : s.SET32 )
  1397.   : s.SET32;
  1398. PROCEDURE SetExcept* [SysBase,-312]
  1399.   ( newSignals [0] : s.SET32;
  1400.     signalSet  [1] : s.SET32 )
  1401.   : s.SET32;
  1402. PROCEDURE Wait* [SysBase,-318]
  1403.   ( signalSet [0] : s.SET32 )
  1404.   : s.SET32;
  1405. PROCEDURE Signal* [SysBase,-324]
  1406.   ( task      [9] : TaskBasePtr;
  1407.     signalSet [0] : s.SET32 );
  1408. PROCEDURE AllocSignal* [SysBase,-330]
  1409.   ( signalNum [0] : LONGINT )
  1410.   : SHORTINT;
  1411. PROCEDURE FreeSignal* [SysBase,-336]
  1412.   ( signalNum [0] : LONGINT );
  1413. PROCEDURE AllocTrap* [SysBase,-342]
  1414.   ( trapNum [0] : LONGINT )
  1415.   : SHORTINT;
  1416. PROCEDURE FreeTrap* [SysBase,-348]
  1417.   ( trapNum [0] : LONGINT );
  1418.  
  1419. (* ------messages ----------------------------------------------------- *)
  1420.  
  1421. PROCEDURE AddPort* [SysBase,-354]
  1422.   ( port [9] : MsgPortBasePtr );
  1423. PROCEDURE RemPort* [SysBase,-360]
  1424.   ( port [9] : MsgPortBasePtr );
  1425. PROCEDURE PutMsg* [SysBase,-366]
  1426.   ( port    [8] : MsgPortBasePtr;
  1427.     message [9] : MessageBasePtr );
  1428. PROCEDURE GetMsg* [SysBase,-372]
  1429.   ( port [8] : MsgPortBasePtr )
  1430.   : MessagePtr;
  1431. PROCEDURE ReplyMsg* [SysBase,-378]
  1432.   ( message [9] : MessageBasePtr );
  1433. PROCEDURE WaitPort* [SysBase,-384]
  1434.   ( port [8] : MsgPortBasePtr );
  1435. PROCEDURE FindPort* [SysBase,-390]
  1436.   ( name [9] : ARRAY OF CHAR )
  1437.   : MsgPortPtr;
  1438.  
  1439. (* ------libraries ---------------------------------------------------- *)
  1440.  
  1441. PROCEDURE AddLibrary* [SysBase,-396]
  1442.   ( library [9] : LibraryBasePtr );
  1443. PROCEDURE RemLibrary* [SysBase,-402]
  1444.   ( library [9] : LibraryBasePtr );
  1445. PROCEDURE OldOpenLibrary* [SysBase,-408]
  1446.   ( libName [9] : ARRAY OF CHAR )
  1447.   : LibraryPtr;
  1448. PROCEDURE CloseLibrary* [SysBase,-414]
  1449.   ( library [9] : LibraryBasePtr );
  1450. PROCEDURE SetFunction* [SysBase,-420]
  1451.   ( library     [9] : LibraryBasePtr;
  1452.     funcOffset  [8] : LONGINT;
  1453.     newFunction [0] : PROC )
  1454.   : PROC;
  1455. PROCEDURE SumLibrary* [SysBase,-426]
  1456.   ( library [9] : LibraryBasePtr );
  1457.  
  1458. (* ------devices ------------------------------------------------------ *)
  1459.  
  1460. PROCEDURE AddDevice* [SysBase,-432]
  1461.   ( device [9] : DeviceBasePtr );
  1462. PROCEDURE RemDevice* [SysBase,-438]
  1463.   ( device [9] : DeviceBasePtr );
  1464. PROCEDURE OpenDevice* [SysBase,-444]
  1465.   ( devName   [8] : ARRAY OF CHAR;
  1466.     unit      [0] : ULONG;
  1467.     ioRequest [9] : MessageBasePtr;
  1468.     flags     [1] : s.SET32 )
  1469.   : SHORTINT;
  1470. PROCEDURE CloseDevice* [SysBase,-450]
  1471.   ( ioRequest [9] : MessageBasePtr );
  1472. PROCEDURE DoIO* [SysBase,-456]
  1473.   ( ioRequest [9] : MessageBasePtr )
  1474.   : SHORTINT;
  1475. PROCEDURE OldDoIO* [SysBase,-456]
  1476.   ( ioRequest [9] : MessageBasePtr );
  1477. PROCEDURE SendIO* [SysBase,-462]
  1478.   ( ioRequest [9] : MessageBasePtr );
  1479. PROCEDURE CheckIO* [SysBase,-468]
  1480.   ( ioRequest [9] : MessageBasePtr )
  1481.   : IORequestPtr;
  1482. PROCEDURE WaitIO* [SysBase,-474]
  1483.   ( ioRequest [9] : MessageBasePtr )
  1484.   : SHORTINT;
  1485. PROCEDURE OldWaitIO* [SysBase,-474]
  1486.   ( ioRequest [9] : MessageBasePtr );
  1487. PROCEDURE AbortIO* [SysBase,-480]
  1488.   ( ioRequest [9] : MessageBasePtr );
  1489.  
  1490. (* ------resources ---------------------------------------------------- *)
  1491.  
  1492. PROCEDURE AddResource* [SysBase,-486]
  1493.   ( resource [9] : APTR );
  1494. PROCEDURE RemResource* [SysBase,-492]
  1495.   ( resource [9] : APTR );
  1496. PROCEDURE OpenResource* [SysBase,-498]
  1497.   ( resName [9] : ARRAY OF CHAR )
  1498.   : APTR;
  1499.  
  1500. (* ------private diagnostic support ----------------------------------- *)
  1501.  
  1502. (* ------misc --------------------------------------------------------- *)
  1503.  
  1504. PROCEDURE RawDoFmt* [SysBase,-522]
  1505.   ( formatString [8] : ARRAY OF CHAR;
  1506.     dataStream   [9] : APTR;
  1507.     putChProc   [10] : PROC;
  1508.     putChData   [11] : APTR )
  1509.     : APTR;
  1510. PROCEDURE RawDoFmtL* [SysBase,-522]
  1511.   ( formatString [8] : ARRAY OF CHAR;
  1512.     dataStream   [9] : ARRAY OF SYS.BYTE;
  1513.     putChProc   [10] : PROC;
  1514.     putChData   [11] : APTR )
  1515.     : APTR;
  1516. PROCEDURE OldRawDoFmt* [SysBase,-522]
  1517.   ( formatString [8] : ARRAY OF CHAR;
  1518.     dataStream   [9] : APTR;
  1519.     putChProc   [10] : PROC;
  1520.     putChData   [11] : APTR );
  1521. PROCEDURE OldRawDoFmtL* [SysBase,-522]
  1522.   ( formatString [8] : ARRAY OF CHAR;
  1523.     dataStream   [9] : ARRAY OF SYS.BYTE;
  1524.     putChProc   [10] : PROC;
  1525.     putChData   [11] : APTR );
  1526. PROCEDURE GetCC* [SysBase,-528] ()
  1527.   : s.SET16;
  1528. PROCEDURE TypeOfMem* [SysBase,-534]
  1529.   ( address [9] : APTR )
  1530.   : s.SET32;
  1531. PROCEDURE Procure* [SysBase,-540]
  1532.   ( VAR semaphore [8] : Semaphore;
  1533.     bidMsg        [9] : SemaphoreMessageBasePtr )
  1534.   : BOOLEAN;
  1535. PROCEDURE Vacate* [SysBase,-546]
  1536.   ( VAR semaport [8] : Semaphore );
  1537. PROCEDURE OpenLibrary* [SysBase,-552]
  1538.   ( libName [9] : ARRAY OF CHAR;
  1539.     version [0] : ULONG )
  1540.   : LibraryPtr;
  1541.  
  1542. (* ---functions in V33 or higher (distributed as Release 1.2) --- *)
  1543.  
  1544. (* ------signal semaphores (note funny registers)---------------------- *)
  1545.  
  1546. PROCEDURE InitSemaphore* [SysBase,-558]
  1547.   ( VAR sigSem [8] : SignalSemaphoreBase );
  1548. PROCEDURE ObtainSemaphore* [SysBase,-564]
  1549.   ( VAR sigSem [8] : SignalSemaphoreBase );
  1550. PROCEDURE ReleaseSemaphore* [SysBase,-570]
  1551.   ( VAR sigSem [8] : SignalSemaphoreBase );
  1552. PROCEDURE AttemptSemaphore* [SysBase,-576]
  1553.   ( VAR sigSem [8] : SignalSemaphoreBase )
  1554.   : BOOLEAN;
  1555. PROCEDURE ObtainSemaphoreList* [SysBase,-582]
  1556.   ( VAR sigSem [8] : List );
  1557. PROCEDURE ReleaseSemaphoreList* [SysBase,-588]
  1558.   ( VAR sigSem [8] : List );
  1559. PROCEDURE FindSemaphore* [SysBase,-594]
  1560.   ( sigSem [9] : ARRAY OF CHAR )
  1561.   : SignalSemaphorePtr;
  1562. PROCEDURE AddSemaphore* [SysBase,-600]
  1563.   ( VAR sigSem [9] : SignalSemaphoreBase );
  1564. PROCEDURE RemSemaphore* [SysBase,-606]
  1565.   ( VAR sigSem [9] : SignalSemaphoreBase );
  1566.  
  1567. (* ------kickmem support ---------------------------------------------- *)
  1568.  
  1569. PROCEDURE SumKickData* [SysBase,-612] ()
  1570.   : ULONG;
  1571.  
  1572. (* ------more memory support ------------------------------------------ *)
  1573.  
  1574. PROCEDURE AddMemList* [SysBase,-618]
  1575.   ( size       [0] : ULONG;
  1576.     attributes [1] : s.SET32;
  1577.     pri        [2] : LONGINT;
  1578.     memBase    [8] : APTR;
  1579.     name       [9] : ARRAY OF CHAR );
  1580. PROCEDURE CopyMem* [SysBase,-624]
  1581.   ( source [8] : ARRAY OF SYS.BYTE;
  1582.     dest   [9] : ARRAY OF SYS.BYTE;
  1583.     size   [0] : ULONG );
  1584. PROCEDURE CopyMemAPTR* [SysBase,-624]
  1585.   ( source [8] : APTR;
  1586.     dest   [9] : APTR;
  1587.     size   [0] : ULONG );
  1588. PROCEDURE CopyMemQuick* [SysBase,-630]
  1589.   ( source [8] : ARRAY OF SYS.BYTE;
  1590.     dest   [9] : ARRAY OF SYS.BYTE;
  1591.     size   [0] : ULONG );
  1592. PROCEDURE CopyMemQuickAPTR* [SysBase,-630]
  1593.   ( source [8] : APTR;
  1594.     dest   [9] : APTR;
  1595.     size   [0] : ULONG );
  1596.  
  1597. (* ------cache -------------------------------------------------------- *)
  1598.  
  1599. (* ---functions in V36 or higher (distributed as Release 2.0) --- *)
  1600.  
  1601. PROCEDURE CacheClearU* [SysBase,-636] ();
  1602. PROCEDURE CacheClearE* [SysBase,-642]
  1603.   ( address [8] : APTR;
  1604.     length  [0] : ULONG;
  1605.     caches  [1] : s.SET32 );
  1606. PROCEDURE CacheControl* [SysBase,-648]
  1607.   ( cacheBits [0] : s.SET32;
  1608.     cacheMask [1] : s.SET32 )
  1609.   : s.SET32;
  1610.  
  1611. (* ------misc --------------------------------------------------------- *)
  1612.  
  1613. PROCEDURE CreateIORequest* [SysBase,-654]
  1614.   ( port [8] : MsgPortBasePtr;
  1615.     size [0] : ULONG )
  1616.   : MessagePtr;
  1617. PROCEDURE DeleteIORequest* [SysBase,-660]
  1618.   ( iorequest [8] : MessageBasePtr );
  1619. PROCEDURE CreateMsgPort* [SysBase,-666] ()
  1620.   : MsgPortPtr;
  1621. PROCEDURE DeleteMsgPort* [SysBase,-672]
  1622.   ( port [8] : MsgPortBasePtr );
  1623. PROCEDURE ObtainSemaphoreShared* [SysBase,-678]
  1624.   ( VAR sigSem [8] : SignalSemaphoreBase );
  1625.  
  1626. (* ------even more memory support ------------------------------------- *)
  1627.  
  1628. PROCEDURE AllocVec* [SysBase,-684]
  1629.   ( byteSize     [0] : ULONG;
  1630.     requirements [1] : s.SET32 )
  1631.   : APTR;
  1632. PROCEDURE FreeVec* [SysBase,-690]
  1633.   ( memoryBlock [9] : APTR );
  1634. PROCEDURE CreatePool* [SysBase,-696]
  1635.   ( requirements [0] : s.SET32;
  1636.     puddleSize   [1] : ULONG;
  1637.     puddleThresh [2] : ULONG )
  1638.   : MemPoolPtr;
  1639. PROCEDURE DeletePool* [SysBase,-702]
  1640.   ( poolHeader [8] : MemPoolPtr );
  1641. PROCEDURE AllocPooled* [SysBase,-708]
  1642.   ( poolHeader [8] : MemPoolPtr;
  1643.     memSize    [0] : ULONG )
  1644.   : APTR;
  1645. PROCEDURE FreePooled* [SysBase,-714]
  1646.   ( poolHeader [8] : MemPoolPtr;
  1647.     memory     [9] : APTR;
  1648.     memSize    [0] : ULONG );
  1649.  
  1650. (* ------misc --------------------------------------------------------- *)
  1651.  
  1652. PROCEDURE AttemptSemaphoreShared* [SysBase,-720]
  1653.   ( VAR sigSem [8] : SignalSemaphoreBase )
  1654.   : BOOLEAN;
  1655. PROCEDURE ColdReboot* [SysBase,-726] ();
  1656. PROCEDURE StackSwap* [SysBase,-732]
  1657.   ( VAR newStack [8] : StackSwapStruct );
  1658.  
  1659. (* ------task trees --------------------------------------------------- *)
  1660.  
  1661. PROCEDURE ChildFree* [SysBase,-738]
  1662.   ( tid [0] : APTR );
  1663. PROCEDURE ChildOrphan* [SysBase,-744]
  1664.   ( tid [0] : APTR );
  1665. PROCEDURE ChildStatus* [SysBase,-750]
  1666.   ( tid [0] : APTR );
  1667. PROCEDURE ChildWait* [SysBase,-756]
  1668.   ( tid [0] : APTR );
  1669.  
  1670. (* ------future expansion --------------------------------------------- *)
  1671.  
  1672. PROCEDURE CachePreDMA* [SysBase,-762]
  1673.   ( address    [8] : APTR;
  1674.     VAR length [9] : ULONG;
  1675.     flags      [0] : ULONG )
  1676.   : APTR;
  1677. PROCEDURE CachePostDMA* [SysBase,-768]
  1678.   ( address    [8] : APTR;
  1679.     VAR length [9] : ULONG;
  1680.     flags      [0] : ULONG );
  1681.  
  1682. (*------New, for V39 *)
  1683.  
  1684. (*---functions in V39 or higher (Release 3) --- *)
  1685.  
  1686. (*------Low memory handler functions *)
  1687.  
  1688. PROCEDURE AddMemHandler* [SysBase,-774]
  1689.   ( memhand [9] : InterruptPtr );
  1690. PROCEDURE RemMemHandler* [SysBase,-780]
  1691.   ( memhand [9] : InterruptPtr );
  1692.  
  1693. (*------Function to attempt to obtain a Quick Interrupt Vector... *)
  1694.  
  1695. PROCEDURE ObtainQuickVector* [SysBase,-786]
  1696.   ( interruptCode [8] : PROC )
  1697.   : ULONG;
  1698.  
  1699.  
  1700. (**-----Module initialisation ---------------------------------------- *)
  1701.  
  1702. <*$LongVars-*>
  1703.  
  1704. BEGIN
  1705.   SYS.GET (absExecBase, SysBase); exec := SysBase
  1706. END Exec.
  1707.